﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WgFrame.Net;

public class RequestHelper
{
    /// <summary>
    /// 开始游戏请求
    /// </summary>
    public static void SendStartRequest()
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.ClientGuId);
        GameNetwork.SendOperation((short)OperationCode.GameStart, parameters, new SendOptions());
    }

    /// <summary>
    /// 获取玩家基本信息请求
    /// </summary>
    public static void SendGetPlayerInfoRequest()
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        GameNetwork.SendOperation((short)OperationCode.PlayerInfo, parameters, new SendOptions());
    }

    /// <summary>
    /// 获取物品信息请求
    /// </summary>
    public static void SendGetPackInfoRequest()
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        GameNetwork.SendOperation((short)OperationCode.ItemInfo, parameters, new SendOptions());
    }

    /// <summary>
    /// 布阵请求
    /// </summary>
    /// <param name="heroId">英雄唯一id</param>
    /// <param name="tagPos">阵位 1-6</param>
    public static void SendBuZhenRequest(long heroId, byte tagPos)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, heroId);
        parameters.Add(3, tagPos);
        GameNetwork.SendOperation((short)OperationCode.BuZhen, parameters, new SendOptions());
    }

    /// <summary>
    /// 上阵请求
    /// </summary>
    /// <param name="heroId">英雄唯一id</param>
    /// <param name="shengZhengPos">上阵位置 0上阵,1-6 换英雄</param>
    public static void SendShangZhenRequest(long heroId, byte shengZhengPos)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, heroId);
        parameters.Add(3, shengZhengPos);
        GameNetwork.SendOperation((short)OperationCode.ShangZhen, parameters, new SendOptions());
    }

    /// <summary>
    /// 脱装备请求
    /// </summary>
    /// <param name="equip">装备</param>
    public static void SendDownEquipRequest(Equip equip)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, equip.szPos);
        parameters.Add(3, (byte)equip.InitEquip.kind);
        GameNetwork.SendOperation((short)OperationCode.DownEquip, parameters, new SendOptions());
    }

    /// <summary>
    /// 穿装备请求
    /// </summary>
    /// <param name="szPos">阵位 1-6</param>
    /// <param name="equipId">装备唯一id</param>
    public static void SendWearEquipRequest(byte szPos, long equipId)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, szPos);
        parameters.Add(3, equipId);
        GameNetwork.SendOperation((short)OperationCode.WearEquip, parameters, new SendOptions());
    }

    /// <summary>
    /// 聊天请求
    /// </summary>
    /// <param name="chatChannel">频道</param>
    /// <param name="msg1">玩家信息</param>
    /// <param name="msg2">聊天信息</param>
    public static void SendChatRequest(string chatChannel, string msg1, string msg2)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, chatChannel);
        parameters.Add(2, msg1);
        parameters.Add(3, msg2);
        GameNetwork.SendOperation((short)OperationCode.Chat, parameters, new SendOptions());
    }

    /// <summary>
    /// 强化请求
    /// </summary>
    /// <param name="equipId">装备唯一id</param>
    public static void SendQiangHuaEquipRequest(long equipId)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, equipId);
        GameNetwork.SendOperation((short)OperationCode.QiangHuaEquip, parameters, new SendOptions());
    }

    /// <summary>
    /// 精炼装备请求
    /// </summary>
    /// <param name="equipId">装备唯一id</param>
    public static void SendJingLianEquipRequest(long equipId)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, equipId);
        GameNetwork.SendOperation((short)OperationCode.JingLianEquip, parameters, new SendOptions());
    }

    /// <summary>
    /// 装备注灵请求
    /// </summary>
    /// <param name="equipId">装备唯一id</param>
    public static void SendZhuLingEquipRequest(long equipId)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, equipId);
        GameNetwork.SendOperation((short)OperationCode.ZhuLingEquip, parameters, new SendOptions());
    }

    /// <summary>
    /// 装备灵石强化请求
    /// </summary>
    /// <param name="equipId">装备唯一Id</param>
    /// <param name="lsType">灵石类型 0:攻击 1:物防 2:法防 3:生命</param>
    public static void SendLingShiQiangHuaRequest(long equipId, byte lsType)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, equipId);
        parameters.Add(3, lsType);
        GameNetwork.SendOperation((short)OperationCode.LingShiQiangHua, parameters, new SendOptions());
    }

    /// <summary>
    /// 购买商品
    /// </summary>
    /// <param name="shopId">商品id</param>
    /// <param name="count">数量</param>
    public static void SendBuyShopRequest(int shopId, int count)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, shopId);
        parameters.Add(3, count);
        GameNetwork.SendOperation((short)OperationCode.BuyShop, parameters, new SendOptions());
    }

    /// <summary>
    /// 招募
    /// </summary>
    /// <param name="zhaoType">招募类型 1:招募一次 2:招募10次</param>
    public static void SendZhaoMuRequest(byte zhaoType)
    {
        Dictionary<byte, object> parameters = new Dictionary<byte, object>();
        parameters.Add(1, GameNetwork.Player.Id);
        parameters.Add(2, zhaoType);
        GameNetwork.SendOperation((short)OperationCode.ZhaoMu, parameters, new SendOptions());
    }
}
